{% extends 'goodies/main2.html' %}

{% block content %}

<td width="100%">
<div style="width: 0px; height: 11px"><spacer type="block" height="11"></spacer></div>
<!-- text -->
<script type="text/javascript">
    function basket_add(book_id,book_price){
        Dajaxice.goodies.basket_add(Dajax.process,{'book_id':book_id,'book_price':book_price})

}



</script>
{% if search %}
{% include "goodies/search_form.html" %}

{% else %}

<script type="text/javascript">
function ChangeSort(obj)
{
    var v = obj.options[obj.selectedIndex].value;
    document.location.href = "?sort23=" + v;
}

</script>


<table border="0" cellspacing="10" cellpadding="0" width="100%">
<form action="index.php" method="get"></form>
<tbody><tr>
<td><div style="height: 0px; width: 145px"><spacer type="block" width="145"></spacer></div></td>
<td width="100%"><div style="height: 0px; width: 1px"><spacer type="block" width="1"></spacer></div></td>
</tr>
<tr>
<td align="right" class="search">Сортировать</td>
<td width="100%"><select name="sort23" style="width: 100%;" onchange="ChangeSort(this);">
        <option value="1">по названию А-Я</option>
        <option value="2">по названию Я-А</option>
        <option value="3">по цене по возрастанию</option>
        <option value="4">по цене по убыванию</option>
        <option value="5">по дате поступления</option>
        <option value="6">по году издания</option>
</select></td>
</tr>
</tbody></table>
{% endif %}


{% for book in books %}
<div style="height: 12px; width: 0px"><spacer type="block" height="12"></spacer></div>
<span class="zag"><a  href="?book_id={{book.pk}}">{{book.name}}</a></span>
<br><br>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody><tr valign="top">
  <td>
    <!-- img -->
<table border="0" cellspacing="1" cellpadding="1" bgcolor="#aeaeae">
<tbody><tr>
  <td bgcolor="#ffffff"><table border="0" cellspacing="1" cellpadding="7" bgcolor="#d6d6d6">
<tbody><tr>
  <td bgcolor="#ffffff"><a href="?book_id={{book.pk}}"><img src="{{thumbnail}}" width="72" height="88" border="0" alt="1812- ый год в каррикатуре"></a><br></td>
</tr>
</tbody></table></td>
</tr>
</tbody></table>
    <!-- /img -->
    <!-- but -->

  
<img href="javascript:;" 
  onclick="basket_add('{{book.pk}}','{{book.price}}');this.src='/common/img/but/add3.gif'"
  src="/common/img/but/{% if book.pk|slugify in basket.keys %}add3.gif{% else %}add.gif{% endif %}"




   width="92" height="23" border="0" alt="положить в корзину">

    </td>
    <td><div style="height: 0px; width: 15px"><spacer type="block" width="15"></spacer></div></td>
    <td width="100%">
    <!-- text -->
    <span class="author">{{book.author}}</span>
    <div style="height: 8px; width: 0px"><spacer type="block" height="8"></spacer></div>
    <span class="search">{{book.year}}</span>
    <div style="height: 8px; width: 0px"><spacer type="block" height="8"></spacer></div>
          <div style="height: 8px; width: 0px"><spacer type="block" height="8"></spacer></div>
<!-- hr -->
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody><tr>
  <td background="/common/img/hr/bg_4.gif"><div style="height: 10px; width: 0px"><spacer type="block" height="10"></spacer></div></td>
</tr>
</tbody></table>
<!-- hr -->
<img src="/common/img/bul/bul_1.gif" width="13" height="8" border="0" align="absmiddle" alt="">&nbsp;&nbsp;<a href="?book_id={{book.pk}}">Подробнее</a>
<!-- hr -->
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody><tr>
  <td background="/common/img/hr/bg_4.gif"><div style="height: 10px; width: 0px"><spacer type="block" height="10"></spacer></div></td>
</tr>
</tbody></table>
<!-- hr -->

<table border="0" cellspacing="0" cellpadding="0">
<tbody><tr valign="bottom">
<td><img src="/common/img/zag/i_price.gif" width="48" height="14" border="0" alt="" vspace="2"><br></td>
<td align="right"><span class="price1"><script language="Javascript">
  a='{{book.price}}.';
  b=a.split('.');
  if (b[2]=='undefined') {
  document.write(b[0]);
  } else {
  while (b[1].length < 2) { b[1] = '0'+b[1]; }
  document.write('<span class="price1">'+b[0]+'</span><span style="font-family: \'Times New Roman\', Times, serif;  font-size:18px; color: #db000a; text-decoration : none;">.'+b[1]+'</span>');
  }

</script>
</span>
</td>
<td><span class="price2">&nbsp; руб.</span>
<div style="width: 0px; height: 2px"><spacer type="block" height="2"></spacer></div>
</td>
</tr>
</tbody></table>





    <!-- /text -->
    </td>
</tr>
</tbody></table>
<!-- hr -->
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody><tr>
  <td background="/common/img/hr/bg_5.gif"><div style="height: 17px; width: 0px"><spacer type="block" height="17"></spacer></div></td>
</tr>
</tbody></table>
<!-- /hr -->
{% endfor %}





    <!-- /text -->
  
<!-- /text -->


    <br><br>


 
{% if books.has_previous %}
            <a href="?page=1"                                style="text-decoration:none;">
              <img src="/common/img/but/n_bb.gif" width="15" height="9" border="0" alt="" align="absmiddle">
              
            </a>
            
            <a href="?page={{ books.previous_page_number }}" style="text-decoration:none;">
              <img src="/common/img/but/n_b.gif" width="9" height="9" border="0" align="absmiddle" alt="">
            </a>

        {% else %}
            
            <img src="/common/img/but/n_bb_f.gif" width="15" height="9" border="0" alt="" align="absmiddle">
            <img src="/common/img/but/n_b_f.gif" width="9" height="9" border="0" align="absmiddle" alt="">
        {% endif %}


        {% for page in books.paginator.page_range %}
            {% if not books.number == page %}
              <a href="?page={{page}}">{{page}}</a>
            {% else %}
              {{page}}
            
            {% endif %}

        {% endfor %}




        {% if books.has_next %}
            <a href="?page={{ books.next_page_number }}"     style="text-decoration:none;">
              <img src="/common/img/but/n_n.gif" width="9" height="9" border="0" align="absmiddle" alt="">
            </a>
            <a href="?page={{ books.paginator.num_pages }}"  style="text-decoration:none;">
              <img src="/common/img/but/n_nn.gif" width="15" height="9" border="0" alt="" align="absmiddle">
            </a>
          {% else %}
             <img src="/common/img/but/n_n_f.gif" width="9" height="9" border="0" align="absmiddle" alt="">
             <img src="/common/img/but/n_nn_f.gif" width="15" height="9" border="0" alt="" align="absmiddle">

        {% endif %}









</td>

{% endblock content %}



